<%@page import="bean.Poll,bean.Question,connection.DbConnection,java.sql.*"%>
	<table border="1" cellspacing="1" cellpadding="1"  bordercolor="silver" align="center">
			<thead>
			<tr>
				<td></td>
				<td></td>
				<td></td>
			</tr>
			</thead>
			<tbody>
			<tr><td>+ Add option</td></tr>
				 <form name = "aa" action = "DeleteQuestionServlet" method="post">
				<%
				Connection conn = new DbConnection().getConn();
				
				String sql = "select question.questionid, question.text, question.status, question.TemplateQuestion, question.qcreatetime from question, Poll_Question where "+
				"question.questionid = Poll_Question.questionid and "+
				"Poll_Question.pollid = " + pid + " and "+
				"Poll_Question.pollversion = " + pver + " ";
				
		    	PreparedStatement st = conn.prepareStatement(sql);
				System.out.println(sql);
		    	ResultSet rs=st.executeQuery();
			
				Question pb = new Question();
				while(rs.next()){
		    		pb.setQuestionID(rs.getInt(1));
		    		pb.setText(rs.getString(2));
		    		pb.setStatus(rs.getInt(3));
		    		//pb.setTemplateQuestion(rs.getInt(4));
		    		//pb.setQCreateTime(rs.getDate(5));
	    		%>
	    		<tr>
					<td><a href='Question.jsp?id=<%=pb.getQuestionID()%>'><%=pb.getQuestionID()%></a></td>
					<td><%=(String)session.getAttribute("pid")%></td>
					<td><%=(String)session.getAttribute("pid")%></td>	
					<td><%//=pb.getTemplateQuestion()%></td>
					<td><%//=pb.getQCreateTime()%></td>
					<td><input type="submit" value="Delete" /></td>
				</tr>
	    		<%	    			
	    		System.out.println(rs.getInt(1));
	    		System.out.println("showq.java qid: "+pb.getQuestionID());
	    	}	
	%>
				</div>
				</form>
			</tbody>
		</table> 
	
	 
	